from langchain_community.chat_models import ChatOpenAI  # ChatOpenAI模型

from langchain.schema import (
    HumanMessage,
    SystemMessage
)

llm = ChatOpenAI(
    temperature = 0.95,
    model_name = "glm-4-flash",
    openai_api_key = "65f85b27091a92ba8fbb32b1bcebfd6a.i6T4GfWNQM5aLF11",
    openai_api_base = "https://open.bigmodel.cn/api/paas/v4/"
)

messages = [
    SystemMessage(content="你是一个很棒的智能助手"),
    HumanMessage(content="请给我的花店起个名")
]
response = llm(messages)
print(response)